package com.zc.im.mapper.user;

import com.zc.im.model.user.ZcUser;
import com.zc.im.model.user.ZcUserExample;
import com.zc.im.model.user.ZcUserKey;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface ZcUserMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_user
     *
     * @mbggenerated
     */
    int countByExample(ZcUserExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_user
     *
     * @mbggenerated
     */
    int deleteByExample(ZcUserExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_user
     *
     * @mbggenerated
     */
    @Delete({
        "delete from zc_user",
        "where uid = #{uid,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(ZcUserKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_user
     *
     * @mbggenerated
     */
    @Insert({
        "insert into zc_user (uid, phone, ",
        "pass, add_time, login_time, ",
        "add_ip, login_ip, type, ",
        "wx_openid, qq_openid, sina_access_token, ",
        "taobao_access_token, app_type, ",
        "is_push, add_type, uniqueness, ",
        "nickname, pic_head)",
        "values (#{uid,jdbcType=INTEGER}, #{phone,jdbcType=CHAR}, ",
        "#{pass,jdbcType=CHAR}, #{addTime,jdbcType=BIGINT}, #{loginTime,jdbcType=INTEGER}, ",
        "#{addIp,jdbcType=CHAR}, #{loginIp,jdbcType=CHAR}, #{type,jdbcType=TINYINT}, ",
        "#{wxOpenid,jdbcType=CHAR}, #{qqOpenid,jdbcType=CHAR}, #{sinaAccessToken,jdbcType=VARCHAR}, ",
        "#{taobaoAccessToken,jdbcType=VARCHAR}, #{appType,jdbcType=TINYINT}, ",
        "#{isPush,jdbcType=BIT}, #{addType,jdbcType=BIT}, #{uniqueness,jdbcType=VARCHAR}, ",
        "#{nickname,jdbcType=VARCHAR}, #{picHead,jdbcType=VARCHAR})"
    })
    int insert(ZcUser record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_user
     *
     * @mbggenerated
     */
    int insertSelective(ZcUser record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_user
     *
     * @mbggenerated
     */
    List<ZcUser> selectByExample(ZcUserExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_user
     *
     * @mbggenerated
     */
    @Select({
        "select",
        "uid, phone, pass, add_time, login_time, add_ip, login_ip, type, wx_openid, qq_openid, ",
        "sina_access_token, taobao_access_token, app_type, is_push, add_type, uniqueness, ",
        "nickname, pic_head",
        "from zc_user",
        "where uid = #{uid,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    ZcUser selectByPrimaryKey(ZcUserKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_user
     *
     * @mbggenerated
     */
    int updateByExampleSelective(@Param("record") ZcUser record, @Param("example") ZcUserExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_user
     *
     * @mbggenerated
     */
    int updateByExample(@Param("record") ZcUser record, @Param("example") ZcUserExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_user
     *
     * @mbggenerated
     */
    int updateByPrimaryKeySelective(ZcUser record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_user
     *
     * @mbggenerated
     */
    @Update({
        "update zc_user",
        "set phone = #{phone,jdbcType=CHAR},",
          "pass = #{pass,jdbcType=CHAR},",
          "add_time = #{addTime,jdbcType=BIGINT},",
          "login_time = #{loginTime,jdbcType=INTEGER},",
          "add_ip = #{addIp,jdbcType=CHAR},",
          "login_ip = #{loginIp,jdbcType=CHAR},",
          "type = #{type,jdbcType=TINYINT},",
          "wx_openid = #{wxOpenid,jdbcType=CHAR},",
          "qq_openid = #{qqOpenid,jdbcType=CHAR},",
          "sina_access_token = #{sinaAccessToken,jdbcType=VARCHAR},",
          "taobao_access_token = #{taobaoAccessToken,jdbcType=VARCHAR},",
          "app_type = #{appType,jdbcType=TINYINT},",
          "is_push = #{isPush,jdbcType=BIT},",
          "add_type = #{addType,jdbcType=BIT},",
          "uniqueness = #{uniqueness,jdbcType=VARCHAR},",
          "nickname = #{nickname,jdbcType=VARCHAR},",
          "pic_head = #{picHead,jdbcType=VARCHAR}",
        "where uid = #{uid,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(ZcUser record);
}